package com.situ.day7.cal;

import org.junit.Test;

public class Demo {

    public static void main(String[] args) {
        Add add = new Add(3, 5);
        int result1 = add.getResult();
        System.out.println(result1);

        Cal cal = new Add(3, 5);
        int result2 = cal.getResult();
        System.out.println(result2);

        cal = new Mul(3, 5);
        int result3 = cal.getResult();
        System.out.println(result3);
    }

    public void cal(Cal cal) {
        int result = cal.getResult();
    }

    @Test
    public void test5() {
        //抽象类是抽象的，不能实例化
        //'Cal' is abstract; cannot be instantiated
        //Cal cal = new Cal();
    }
}
